package tool;

import BIll.BLLAbstract;

@SuppressWarnings("unchecked")
public class BllFactory {
	private volatile static BllFactory bf;
	
	private BllFactory(){};
	
	public static BllFactory getBllFactory(){
		if(bf == null){
			synchronized (BllFactory.class) {
				if(bf==null){
				bf = new BllFactory();
				}
			}	
		}
		return bf;
	}
	public <T extends BLLAbstract> T getInstance(Class<T> c){
		T bllobject = null;
		try {
			bllobject = (T)Class.forName(c.getName()).newInstance();
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return bllobject;
	}
}